{extend name="base" /}
{block name="body"}

    <!--tab标签-->
    <div class="layui-tab-brief">

        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" data-url="{:url('admin/forumcate/update')}"  localtion-url="{:url('forumcate/index')}">
                 <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
	  <input type="text" name="sort" placeholder="仅限整数" autocomplete="off" class="layui-input" value="{$tptc.sort}">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">板块名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" value="{$tptc.name}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item" style="width: 300px;">
    <label class="layui-form-label">所属板块</label>
    <div class="layui-input-block">
      <select name="tid">
       <option value="0">顶级板块</option>
        {volist name="$category_level_list" id="vo"}
        <option value="{$vo.id}" {if condition="$tptc['id'] eq $vo['id']"}disabled=""{/if}{if condition="$tptc['tid'] eq $vo['id']"}selected="selected"{/if}>{neq name="vo.level" value="1"}|{php}for($i=1;$i<$vo['level'];$i++){echo ' --';}{/php}{/neq}{$vo.name}</option>
        {/volist}
      </select>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">所属类型</label>
    <div class="layui-input-block">
      <input type="radio" name="type" value="1" title="帖子" {if condition="$tptc['type'] eq 1"}checked=""{/if}>
    
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">板块图片</label>
    <div class="layui-input-block">
      <input type="file" name="file" class="layui-upload-file" id="image" style="float: left;">
	  <input type="text" name="pic" value="{$tptc.pic}" class="layui-input" style="position: absolute;left: 111px;top: 0px;width: 500px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">关键词</label>
    <div class="layui-input-block">
      <input type="text" name="keywords" value="{$tptc.keywords}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">描述</label>
    <div class="layui-input-block">
      <textarea name="description" placeholder="请输入内容" class="layui-textarea">{$tptc.description}</textarea>
    </div>
  </div>
                  <input type="hidden" name="id" value="{$tptc.id}">
                    <div class="btable-paged" >
				<div class="layui-main">
                    <div class="formbtngroup">
<button class="layui-btn layui-btn-small" lay-submit="" lay-filter="formadd">更新</button>
<button onclick="history.go(-1);" class="layui-btn layui-btn-primary layui-btn-small">返回</button>
</div>
</div>
        </div>
                </form>
            </div>
        </div>
    </div>

{/block}

{block name="js"}
<script type="text/javascript" src="__ADMIN__/js/formadd.js"></script>

{/block}
{block name="script"}
<script>
layui.use(['form', 'upload'],function(){
  var form = layui.form()
  ,jq = layui.jquery;
  
  layui.upload({
    url: '{:url("upload/upimage")}'
    ,elem:'#image'
    ,before: function(input){
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
    }
    ,success: function(res){
      layer.close(loading);
      jq('input[name=pic]').val(res.path);
      layer.msg(res.msg, {icon: 1, time: 1000});
    }
  });


})
</script>
{/block}